/*
 * Copyright © 2017 eqxiu.com 北京中网易企秀科技有限公司  All rights reserved.
 */
package cn.hermit.data.xml.ns;

/**
 * Enhanced QName definition. 
 * 
 * @author Jack Gao (Chinese name : GAO JIANGUO, Email : linux.gjg@gmail.com)
 * @date 1 Jul, 2014
 */
public final class QName extends javax.xml.namespace.QName {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2371436982427307970L;

	NamespaceContext namespaceContext;

	int nsLayer;
	
	/**
	 * Constructor with name space URI, local part and prefix.
	 * 
	 * @param namespaceURI
	 * 		The URI of name space
	 * @param localPart
	 * 		The local part of QName
	 * @param prefix
	 * 		The prefix of QName
	 */
	public QName(String namespaceURI, String localPart, String prefix) {
		super(namespaceURI, localPart, prefix);
	}

	/**
	 * Constructor with name space URI, local part.
	 * 
	 * @param namespaceURI
	 * 		The URI of name space
	 * @param localPart
	 * 		The local part of QName
	 */
	public QName(String namespaceURI, String localPart) {
		super(namespaceURI, localPart);
	}

	/**
	 * Constructor with local part.
	 * 
	 * @param localPart
	 * 		The local part of QName
	 */
	public QName(String localPart) {
		super(localPart);
	}

	/**
	 * Get name space context.
	 * 
	 * @return The name space context
	 */
	public NamespaceContext getNamespaceContext() {
		if (namespaceContext == null)
			return null;
		namespaceContext.nsLayer = nsLayer;
		return namespaceContext;
	}

}